package cn.epsilon3.constant;

/**
 * 常量类
 *
 * @author epsilon3
 * @date 2023-05-05
 */
public enum HttpMethodEnum {


    GET("GET"),
    POST("POST"),
    DELETE("DELETE"),
    PUT("PUT"),
    PATCH("PATCH");
    private final String type;

    HttpMethodEnum(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public static HttpMethodEnum getType(String methodThpe) {
        String upperCase = methodThpe.toUpperCase();
        for (HttpMethodEnum httpMethodEnum : HttpMethodEnum.values()) {
            if (httpMethodEnum.type.equals(upperCase)) {
                return httpMethodEnum;
            }
        }
        return null;
    }


}
